package neu.soft.service.impl;

import neu.soft.mapper.StateUpdateMapper;
import neu.soft.service.StateUpdateService;
import neu.soft.vo.ResultBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Map;
@Service
public class StateUpdateServiceImpl implements StateUpdateService {

    @Autowired
    StateUpdateMapper stateUpdateMapper;
    @Override
    public ResultBean typeUpdate(Map<String, Object> map) {
        ResultBean re=new ResultBean();
        int temp=stateUpdateMapper.queryOrderByOid(map);
        if (temp>0){
            stateUpdateMapper.typeUpdate(map);
        }else {
            re=ResultBean.error();
            re.setMsg("缺货单修改失败");
        }
        return re;
    }

    @Override
    public ResultBean statusUpdate(Map<String, Object> map) {
        System.out.println("更改状态"+map);
        ResultBean re=new ResultBean();
        int temp=stateUpdateMapper.queryOrderByOid(map);
        if (temp>0){
            stateUpdateMapper.statusUpdate(map);
        }else {
            re=ResultBean.error();
            re.setMsg("订单状态修改失败");
        }
        return re;
    }


}
